package com.quick.develop.flowable.application;

import com.quick.develop.flowable.domain.dto.instance.BpmProcessInstanceDTO;
import com.quick.develop.flowable.domain.dto.task.BpmTaskDTO;
import com.quick.develop.flowable.domain.vo.instance.BpmProcessInstanceCancelReqVO;
import com.quick.develop.flowable.domain.vo.instance.BpmProcessInstanceCreateReqVO;
import com.quick.develop.flowable.domain.vo.task.BpmTaskLogReqVO;

import javax.validation.Valid;
import java.util.List;

/**
 * @author junyuan.liu
 * @description: 流程实例接口
 * @date 2022/5/30 19:44
 */
public interface IBpmProcessInstanceApplication {
    /**
     * @param reqVO 请求体
     * @return java.lang.String
     * @description 流程启动并完成第一个节点
     * @author junyuan.liu
     * @date 2022/6/6 14:14
     */
    String startProcess(@Valid BpmProcessInstanceCreateReqVO reqVO);

    /**
     * @param reqVO 请求体
     * @return java.util.List<com.quick.develop.flowable.domain.dto.task.BpmTaskDto>
     * @description 获取流程实例所有的任务记录 包括主子流程
     * @author junyuan.liu
     * @date 2022/8/12 13:41
     */
    List<BpmTaskDTO> getProcessLogs(BpmTaskLogReqVO reqVO);

    /**
     * @param processInstanceId 流程实例ID
     * @return java.util.List<com.quick.develop.flowable.domain.dto.task.BpmTaskDTO>
     * @description 通过流程实例ID获取流程日志
     * @author junyuan.liu
     * @date 2022/10/17 14:46
     */
    List<BpmTaskDTO> getLogsByProcessInstanceId(String processInstanceId);

    /**
     * @param businessKey 业务ID
     * @return com.quick.develop.flowable.domain.instance.BpmProcessInstanceRespVO
     * @description 获取主流程信息
     * @author junyuan.liu
     * @date 2022/8/28 9:29
     */
    BpmProcessInstanceDTO getMainProcessInstanceByBusinessKey(String businessKey);

    /**
     * @param id ProcessInstanceId
     * @return com.quick.develop.flowable.domain.dto.instance.BpmProcessInstanceDTO
     * @description 获取主流程信息
     * @author junyuan.liu
     * @date 2022/11/10 12:32
     */
    BpmProcessInstanceDTO getMainProcessInstanceByProcessInstanceId(String id);

    /**
     * @param cancelReqVO cancelReqVO
     * @description 终止正在运行的流程实例
     * @author junyuan.liu
     * @date 2022/9/20 9:27
     */
    void cancelProcessInstance(BpmProcessInstanceCancelReqVO cancelReqVO);
}
